package test1;

import java.util.ArrayList;
import java.util.List;

public class MultiThreadTest {

    public static void main(String[] args) {
        List<TestThread> threads = new ArrayList();
        for (int i = 0; i < 20 ; i++){
            threads.add(new TestThread());
        }
        threads.forEach(thread -> thread.start());
    }
}

class TestThread extends Thread{
    @Override
    public void run(){
        Singleton instance = Singleton.getSingleton();
        System.out.println(instance);
    }
}